import request from '@/utils/request'




//添加
export function addUser(data) {
  return request({
    url: '/user/insertUser',
    method: 'post',
    data
  })
}

//获取列表
export function userList(data) {
  return request({
    url: '/user/selectUserPage',
    method: 'get',
    params: data
  })
}

//获取单个数据
export function viewUser(data) {
  return request({
    url: `/user/selectUser/${data}`,
    method: 'get'
  })
}

//更新
export function editUser(data) {
  return request({
    url: `/user/updateUser`,
    method: 'put',
    data
  })
}

//删除
export function deleteUser(data) {
  return request({
    url: `/user/deleteUser/${data}`,
    method: 'delete'
  })
}

//获取列表
export function userListByRoleId(data) {
  return request({
    url: `/user/selectUsersByRoleId/${data}`,
    method: 'get'
  })
}


